package com.example.onlinemusic.mapper;

import com.example.onlinemusic.model.Music;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface MusicMapper {
    //上传音乐
    int insert(String title,String singer,String time,String url,int userid);
    //判断上传音乐是否重复
    Music repeatMusic(String title,String singer);
    //根据id查找是否存在此音乐
    Music findMusicById(int id);
    //根据id删除音乐
    int deleteMusicById(int id);
    //查询全部音乐
    List<Music> findMusic();
    //根据名称查询音乐(模糊查询)
    List<Music> findMusicByName(String title);
    //根据用户id和名称模糊查询
    Music findMusicByNameAndMID(String title,int id);

}
